package com.henghe.frame.auth.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.henghe.frame.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2024/6/6 15:17
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_role")
public class SysRole extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty("角色编号")
    private String roleNo;

    @ApiModelProperty("角色名称")
    private String roleName;

    @ApiModelProperty(value = "是否系统角色1是0否")
    private Integer isSystem;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    private Integer useStatus;

    private String remark;

    @TableField(exist = false)
    private List<SysMenu> menus;

    @TableField(exist = false)
    private List<SysPermission> permissions;

}
